/**
 * 角色信息编辑controller.
 * @author 苏亚欣
 * @version 1.0.0, 2015-07-14
 */
Ext.define('MyApp.view.MenuEditView', {
	extend : 'Ext.window.Window',
	alias : 'widget.menueditview',
	id : 'menueditview',
	title : '菜单信息编辑',
	resizable : false,
	closeAction : 'hide',
	constrainHeader:true,
	width : 360,
	height : 275,
	//layout : 'fit',
	modal : true,
	layout: {
		align: 'middle',
		pack: 'center',
		type: 'hbox'
	},
	initComponent : function() {
		this.items = [{
			xtype : 'form',
			border : false,
			padding: 10,
			items : [
				{
				xtype : 'panel',
		        layout:'column',
			    border: false,
		        defaults : {
	    			labelAlign : 'right',
	    			labelWidth : 70,
		        	margin: '5'
		        },
	    		items: [{
	    			xtype: 'textfield',
	        		width: 300,
	        		name: 'menu_name',
	        		allowBlank : false,
	        		fieldLabel:'菜单名称',
	        		length: 20
	        		//vtypeText : '角色名称最多可输入20个字符',
	        		//vtype: 'limitLen'
				}]
			},
				{
					xtype : 'panel',
					layout:'column',
					border: false,
					defaults : {
						labelAlign : 'right',
						labelWidth : 70,
						margin: '5'
					},
					items: [{
						xtype: 'textfield',
						width: 300,
						name: 'menu_icon',
						//allowBlank : false,
						fieldLabel:'菜单图标'
						//length: 20
						//vtypeText : '角色名称最多可输入20个字符',
						//vtype: 'limitLen'
					}]
				},
				{
					xtype : 'panel',
					layout:'column',
					border: false,
					defaults : {
						labelAlign : 'right',
						labelWidth : 70,
						margin: '5'
					},
					items: [
						{
							xtype:'combobox',
							fieldLabel:'父菜单',
							editable: false,
							name:'menu_parent',
							labelWidth :70,
							width : 300,
							displayField: 'menu_name',
							valueField: 'menu_pk',
							store: Ext.create('MyApp.store.MenuStore'),
							value: '0'
						}]
				},
				{
					xtype : 'panel',
					layout:'column',
					border: false,
					defaults : {
						labelAlign : 'right',
						labelWidth : 70,
						margin: '5'
					},
					items: [{
						xtype: 'textfield',
						width: 300,
						name: 'menu_url',
						allowBlank : false,
						fieldLabel:'菜单url',
						length: 20
						//vtypeText : '角色名称最多可输入20个字符',
						//vtype: 'limitLen'
					}]
				}]
		}],
		
		this.fbar = [{
    		xtype: 'button',
        	margin: '6',
        	text: '保存',
        	name: 'btn-save',
			iconCls: 'btn-save'
    	},{
    		xtype: 'button',
        	margin: '6',
        	text: '取消',
        	name: 'btn-cancel',
			iconCls: 'btn-cancel',
        	scope: this,
        	handler: this.close
    	}];
		
		this.callParent(arguments);
	}
});